package com.liaozibo.demo.seckill.web.controller;

import com.liaozibo.demo.seckill.support.export.dto.OrderDTO;
import com.liaozibo.demo.seckill.support.export.dto.Result;
import com.liaozibo.demo.seckill.support.export.service.SettlementExportService;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 结算页（属于秒杀系统）
 * */
@RestController
@RequestMapping("/settlement")
public class SettlementController {

    @DubboReference
    private SettlementExportService settlementExportService;

    @PostMapping("/submitOrder")
    public Result submitOrder(@RequestBody OrderDTO orderDTO) {
        return settlementExportService.submitOrder(orderDTO);
    }
}
